﻿using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace Sautom.WcfServer
{
    // Provide the ProjectInstaller class which allows 
    // the service to be installed by the Installutil.exe tool
    [RunInstaller(true)]
    public sealed class ProjectInstaller : Installer
    {
        private readonly ServiceProcessInstaller _process;
        private readonly ServiceInstaller _service;

        public ProjectInstaller()
        {
            _process = new ServiceProcessInstaller();
            _process.Account = ServiceAccount.LocalSystem;
            _service = new ServiceInstaller();
            _service.ServiceName = "WCFWindowsHostService";
            Installers.Add(_process);
            Installers.Add(_service);
        }
    }
}